solve :: Double -> Double
solve x = foldl1 (+) fs
    where f 0 = 1
          f n = x ** n / product [1..n]
          fs = map f [0..9]

main :: IO ()
main = getContents >>= mapM_ print. map solve. map (read::String->Double). tail. words
